<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="订单编号" prop="orderNumber">
        <el-input v-model="queryParams.orderNumber" placeholder="请输入订单编号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="客户" prop="custom">
        <el-input v-model="queryParams.custom" placeholder="请输入客户" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="订单状态" prop="orderStatus">
        <el-select v-model="queryParams.orderStatus" placeholder="请选择订单状态" clearable>
          <el-option v-for="dict in dict.type.mes_proorder_status" :key="dict.value" :label="dict.label"
            :value="dict.value" />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
          v-hasPermi="['mes:proorder:add']">新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
          v-hasPermi="['mes:proorder:edit']">修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
          v-hasPermi="['mes:proorder:remove']">删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
          v-hasPermi="['mes:proorder:export']">导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="proorderList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="订单编号" align="center" prop="orderNumber" />
      <el-table-column label="订单名称" align="center" prop="orderName" />
      <el-table-column label="客户" align="center" prop="custom" />
      <el-table-column label="需求数量" align="center" prop="orderDemandNum" />
      <el-table-column label="订单状态" align="center" prop="status">
        <template slot-scope="scope">
          <el-tag :type="tagType(scope.row.status)" effect="dark">
            <dict-tag :options="dict.type.mes_proorder_status" :value="scope.row.status" />
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column label="下单时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-edit" @click="outInHou(scope.row)"
            v-hasPermi="['mes:proorder:edit']">产品出库</el-button>
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
            v-hasPermi="['mes:proorder:edit']">修改</el-button>
          <!-- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
            v-hasPermi="['mes:proorder:remove']">删除</el-button> -->
        </template>
      </el-table-column>
    </el-table>

    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />




    <el-drawer id="stockDrawer" title="产品出库" :visible.sync="outInHouOpen" v-if="outInHouOpen" direction="rtl" size="50%">
      <el-scrollbar style="height: 100%;" class="scrollbar-wrapper">
        <el-divider content-position="left">订单信息</el-divider>
        <div style="border-radius: 15px;margin: 5px;">
          <div style="text-align: center;">
            <div
              style="display: inline-block;margin-right: 20px;background-color: rgb(255, 255, 255);padding: 7px;border-radius: 5px;width: 170px;">
              <span>订单编码:</span><label>{{
                nowData.orderNumber }}</label>
            </div>
            <div
              style="display: inline-block;margin-right: 20px;background-color: rgb(255, 255, 255);padding: 7px;border-radius: 5px;width: 170px;">
              <span>订单名称:</span><label>{{
                nowData.orderName }}</label>
            </div>
            <div
              style="display: inline-block;margin-right: 20px;background-color: rgb(255, 255, 255);padding: 7px;border-radius: 5px;width: 170px;">
              <span>客户:</span><label>{{
                nowData.custom }}</label>
            </div>
          </div>
        </div>

        <el-divider content-position="left">出 库 计 划</el-divider>

        <el-card style="margin: 5px;border-radius: 15px;" shadow="always">
          <el-table :data="form.proInfoList" border style="width: 100%;border-radius: 15px;">
            <el-table-column align="center" prop="proName" label="产品名称">
            </el-table-column>
            <el-table-column align="center" prop="proCode" label="产品编码">
            </el-table-column>
            <el-table-column align="center" prop="orderStatus" label="出库状态">
              <template slot-scope="scope">
                <el-tag :type="orderStatustagType(scope.row.orderStatus)" effect="dark">
                  <dict-tag :options="dict.type.mes_outhou_status" :value="scope.row.orderStatus" />
                </el-tag>
              </template>
            </el-table-column>
            <el-table-column label="单价" align="center" prop="price">
              <template slot-scope="scope">
                {{ (scope.row.price).toFixed(2) + '元' }}
              </template>
            </el-table-column>
            <el-table-column align="center" prop="orderDemandNum" label="产品数量">
            </el-table-column>  
          </el-table>
        </el-card>

        <el-tabs v-model="activeName" @tab-click="outInHou(nowData)" type="border-card" style="margin: 5px;">
          <el-tab-pane label="产品出库" name="first">

            <div style="text-align: center;padding: 10px;width: 100%;display: inline-block;border-radius: 15px;">
              <!-- <el-divider content-position="left">出 库 产 品</el-divider> -->
              <div>
                <el-scrollbar style="height: 270px;" class="scrollbar-wrapper">
                  <transition name="el-fade-in-linear" v-for="(item, index) in inHouTableData" :key="item.id">
                    <transition name="el-fade-in">
                      <el-card id="stockCard"
                        style="border-radius: 15px;position: relative;background-color: rgb(210, 229, 245);margin-bottom: 5px;"
                        shadow="always">
                        <div style="display: flex;position: relative;width: 80%;">
                          <div class="chooseStockDiv">
                            <h4>产品名称</h4>
                            <label
                              style="background-color: rgba(172, 172, 172, 0.6);padding: 5px;border-radius: 5px;display: block;">{{
                                item.proName }}</label>
                          </div>
                          <div class="chooseStockDiv">
                            <h4>产品编码</h4>
                            <label
                              style="background-color: rgba(172, 172, 172, 0.6);padding: 5px;border-radius: 5px;display: block;">{{
                                item.proCode }}</label>
                          </div>
                          <div class="chooseStockDiv">
                            <h4>库房名称</h4>
                            <label
                              style="background-color: rgba(172, 172, 172, 0.6);padding: 5px;border-radius: 5px;display: block;">{{
                                item.houName }}</label>
                          </div>
                          <div class="chooseStockDiv">
                            <h4>库存数量</h4>
                            <label
                              style="background-color: rgba(172, 172, 172, 0.6);padding: 5px;border-radius: 5px;display: block;">{{
                                item.proQuantity }}</label>
                          </div>
                        </div>
                        <div
                          style="display: flex;text-align: center;position: absolute;right: 0;top: 0; height: 100%;width: 80px;align-items: center;justify-content: center;">
                          <el-button id="daohuobtn" type="danger" icon="el-icon-delete" circle
                            @click="chooseStockDel(index)"></el-button>
                        </div>
                      </el-card>

                    </transition>
                  </transition>

                  <el-empty v-if="inHouTableData.length == 0" :image-size="150"></el-empty>
                </el-scrollbar>
              </div>
              <div style="text-align: center;padding-top: 5px;">
                <label style="margin-right: 15px; margin-left: 8px;">出库产品:</label>
                <el-select size="mini" style="width: 25%;" v-model="stockvalue" filterable placeholder="请选择出库产品"
                  @change="stockChange">
                  <el-option style="height: auto;" v-for="item in proStockOptions" :key="item.id" :label="item.proName"
                    :value="item.id">
                    <el-card id="stockOptionCard" shadow="hover">
                      <div style="display: flex;">
                        <div id="stockDiv">
                          <el-tag type="" effect="dark" id="stockTag">
                            库位
                          </el-tag>
                          <span id="stockSpan">{{ item.locatorCode }}</span>
                        </div>
                        <div id="stockDiv">
                          <el-tag type="" effect="dark" id="stockTag">
                            库房名称
                          </el-tag>
                          <span id="stockSpan">{{ item.houName }}</span>
                        </div>
                        <div id="stockDiv">
                          <el-tag type="" effect="dark" id="stockTag">
                            产品名称
                          </el-tag>
                          <span id="stockSpan">{{ item.proName }}</span>
                        </div>
                        <div id="stockDiv">
                          <el-tag type="" effect="dark" id="stockTag">
                            产品编码
                          </el-tag>
                          <span id="stockSpan">{{ item.proCode }}</span>
                        </div>
                        <div id="stockDiv">
                          <el-tag type="" effect="dark" id="stockTag">
                            库存数量
                          </el-tag>
                          <span id="stockSpan">{{ item.proQuantity }}</span>
                        </div>
                      </div>

                    </el-card>
                  </el-option>
                </el-select>
                <label style="margin-left: 20px;margin-right: 15px;">出库时间:</label>
                <el-date-picker style="width: 170px;" size="mini" v-model="proOutTime" type="date" placeholder="选择日期"
                  format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
                </el-date-picker>
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="出库记录" name="second">
            <el-empty :image-size="150" v-if="outHouInfoData.length == 0"></el-empty>
            <div v-else style="margin: 5px;">
              <el-card id="getHouInfoCard" shadow="never" v-for="(item, index) in outHouInfoData"
                style="border-radius: 10px;background-color: rgba(215, 215, 215, 0.662);">
                <div style="display: flex;">
                  <div style="display: inline-block;flex: 1;margin-right: 10px;"><label
                      style="background-color: rgb(186, 223, 255);padding: 5px;border-radius: 7px;">出库产品:</label> {{
                        item.proName }}</div>
                  <div style="display: inline-block;flex: 1;margin-right: 10px;"><label
                      style="background-color: rgb(186, 223, 255);padding: 5px;border-radius: 7px;">出库人:</label> {{
                        item.outhouPerson }}</div>
                  <div style="display: inline-block;flex: 1;margin-right: 10px;"><label
                      style="background-color: rgb(186, 223, 255);padding: 5px;border-radius: 7px;">出库数量:</label> {{
                        item.proQuantity }}</div>
                        <div style="display: inline-block;flex: 1;margin-right: 10px;"><label
                      style="background-color: rgb(186, 223, 255);padding: 5px;border-radius: 7px;">成交额:</label> {{
                        (item.businessVolume).toFixed(2)+'元' }}</div>
                  <div style="display: inline-block;flex: 1;margin-right: 10px;"><label
                      style="background-color: rgb(186, 223, 255);padding: 5px;border-radius: 7px;">出库日期:</label> {{
                        parseTime(item.outhouDate, '{y}-{m}-{d}') }}</div>
                </div>
              </el-card>
            </div>
            <div slot="footer" class="dialog-footer">
              <el-button type="primary" @click="outHouInfo = false">确 定</el-button>
              <el-button @click="outHouInfo = false">取 消</el-button>
            </div>

          </el-tab-pane>
        </el-tabs>

        <div style="text-align: center;margin-top: 30px;">
          <el-button type="primary" plain @click="chuku">出 库</el-button>
          <el-button type="info" plain @click="quxiao">取 消</el-button>
        </div>
      </el-scrollbar>

    </el-drawer>






    <!-- 添加或修改产品订单对话框 -->
    <el-dialog :title="title" :visible.sync="open" v-if="open" width="700px" append-to-body>
      <el-form style="text-align:center;" ref="form" :model="form" :rules="rules" label-width="80px" :inline="true">
        <el-form-item :disabled="banexit" label="订单名称" prop="orderName">
          <el-input v-model="form.orderName" placeholder="请输入订单名称" style="width: 220px;" />
        </el-form-item>
        <el-form-item label="订单编号" prop="orderNumber">
          <el-input :disabled="proCodeExitStatus" v-model="form.orderNumber" placeholder="请输入订单编号"
            style="width: 220px;" />
        </el-form-item>

        <el-form-item label="下单时间" prop="createTime">

          <el-date-picker style="width: 220px;" v-model="form.createTime" type="date" placeholder="选择日期"
            format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="客户" prop="custom">
          <el-select style="width: 220px;" v-model="form.custom" placeholder="请选择客户">
            <el-option v-for="dict in dict.type.mes_custom" :key="dict.value" :label="dict.label"
              :value="dict.value"></el-option>
          </el-select>
        </el-form-item>



        <el-form-item label="备注" prop="remark">
          <el-input style="width: 220px;" v-model="form.remark" placeholder="请输入备注" />
        </el-form-item>
      </el-form>
      <el-divider>产 品 列 表</el-divider>
      <el-button :disabled="banexit" style="margin-bottom: 10px;" type="primary" @click="proadd">添 加</el-button>

      <el-scrollbar style="height:330px;width: 100%;">
        <transition name="el-fade-in-linear" v-for="(item, index) in form.proInfoList">
          <transition name="el-fade-in">
            <el-card id="procard" style="position: relative;" shadow="never">
              <div style="display: inline-block;">
                <div
                  style="background-color: rgba(218, 217, 213, 0.664);padding: 5px;border-radius: 7px;margin-bottom: 10px;">
                  <label style="font-weight: 700;font-style:oblique;margin-right: 5px;">产品名称:</label>
                  <el-select size="mini" style="width: 120px;" :disabled="banexit" v-model="form.proInfoList[index].id"
                    filterable placeholder="请选择" @change="(option) => proselectchang(option, index)">
                    <el-option v-for="item in proselectoptions" :key="item.id" :label="item.proName" :value="item.id">
                    </el-option>
                  </el-select>
                </div>
                <div style="background-color: rgba(218, 217, 213, 0.664);padding: 5px;border-radius: 7px;">
                  <label style="margin-top: 10px;font-weight: 700;font-style:oblique;margin-right: 5px;">产品编码:</label>
                  <label style="height: 24px;">{{ item.proCode }}</label>
                </div>

              </div>
              <div
                style="display: inline-block;position: absolute;top: 23%;left: 50%;text-align: center;background-color: rgba(252, 248, 235, 0.724);padding: 5px;border-radius: 7px;">
                <h3
                  style="font-weight: 700;font-style:oblique;background-color: rgba(158, 166, 174, 0.1);border-radius: 5px;">
                  数量</h3>
                <el-input-number size="mini" :disabled="banexit" v-model="form.proInfoList[index].orderDemandNum"
                  :min="0"></el-input-number>
              </div>
              <div style="display: inline-block;float: right;">
                <el-button :disabled="banexit" style="display: block;float: right;clear:both;" type="success"
                  icon="el-icon-plus" circle @click="proadd(index)"></el-button>
                <el-button :disabled="banexit"
                  style="display: block;float: right;clear:both;position: relative;top: 10px;" type="danger"
                  @click="prodel(index)" icon="el-icon-delete" circle></el-button>
              </div>
            </el-card>
          </transition>
        </transition>
        <el-empty v-if="form.proInfoList.length == 0" :image-size="200"></el-empty>

      </el-scrollbar>

      <div slot="footer" class="dialog-footer">

        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>



  </div>
</template>

<script>
import { listProorder, getProorder, delProorder, addProorder, updateProorder, proOuthou, getOutHouInfo } from "@/api/mes/proorder";
import { listProinfo } from "@/api/mes/proinfo"
import { listStock } from "@/api/mes/stock";
export default {
  name: "Proorder",
  dicts: ['mes_proorder_status', 'mes_custom', 'mes_outhou_status'],
  data() {
    return {
      //标签页起始页
      activeName: "first",
      //出库时间
      proOutTime: "",
      //出库产品下拉框绑定值(仅做展示用)
      stockvalue: "",
      //出库产品表格数据
      inHouTableData: [],
      //产品库存下拉框数据
      proStockOptions: [],
      //当前点击记录id
      nowid: null,
      //当前点击记录数据
      nowData: null,
      //产品出库抽屉
      outInHouOpen: false,
      //订单出库记录数据
      outHouInfoData: [],
      /**
       * 不允许修改产品订单部分数据
       */
      banexit: false,
      /**
       * 订单编号能否修改
       */
      proCodeExitStatus: false,
      /**
       * 产品下拉框数据
       */
      proselectoptions: [],
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 产品订单表格数据
      proorderList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        orderNumber: null,
        custom: null,
        orderStatus: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {

    //标签类型判断
    orderStatustagType(status) {
      switch (status) {
        case 0:
          return ""
        case 1:
          return "success"
      }
    },
    //标签类型判断
    tagType(status) {
      switch (status) {
        case 0:
          return ""
        case 1:
          return "warning"
        case 2:
          return "success"
      }
    },
    //出库产品不合理性判断
    judgmentOnTheIrrationalityOfOutboundProducts() {
      let flag = 0;
      this.inHouTableData.forEach(item => {
        if (this.form.proInfoList.findIndex(e => { return e.proCode == item.proCode }) == -1 ||
          this.form.proInfoList[this.form.proInfoList.findIndex(e => { return e.proCode == item.proCode })].orderStatus == 1) {
          flag = 1;
        }
      })
      if (flag == 1) {
        return true;
      }
      return false;
    },
    //出库
    chuku() {
      //出库产品合理性判断
      if (this.inHouTableData.length > this.form.proInfoList.length || this.judgmentOnTheIrrationalityOfOutboundProducts()) {
        this.$notify({
          title: '错误',
          message: '非订单产品或订单已经出库',
          type: 'error',
          position: 'top-left'
        });
      } else {
        //时间判空和选择产品判空
        if (this.proOutTime == "" || this.inHouTableData.length == 0) {
          this.$notify({
            title: '错误',
            message: '请选择出库时间或出库产品',
            type: 'error',
            position: 'top-left'
          });
        } else {
          let proOrderIdList = [];
          //拿出库存产品id
          this.inHouTableData.forEach(item => {
            proOrderIdList.push(item.id)
          });
          proOuthou({ ids: proOrderIdList, proOrderId: this.nowid, outhouDate: this.proOutTime }).then(res => {
            this.outInHouOpen = false
            this.getList()
            this.$modal.msgSuccess("出库成功");
          })
        }

      }
    },
    //抽屉取消
    quxiao() {
      this.outInHouOpen = false

    },
    //出库产品删除
    chooseStockDel(index) {
      this.inHouTableData.splice(index, 1)
    },
    //出库产品下拉框改变事件
    stockChange(option) {
      let ss = this.proStockOptions[this.proStockOptions.findIndex(e => { return e.id == option })]
      if (this.inHouTableData.findIndex(e => { return e.id == ss.id }) == -1) {
        this.inHouTableData.push(ss)
      } else {
        this.$notify({
          title: '错误',
          message: '请不要重复选择相同库存产品',
          type: 'error',
          position: 'top-left'
        });
      }
      this.stockvalue = "";
    },
    //产品出库按钮
    outInHou(row) {
      this.nowData = row
      this.nowid = row.id
      this.outInHouOpen = true
      this.inHouTableData = []
      this.proOutTime = ""
      listStock().then(res => {
        this.proStockOptions = res.rows
      })
      getProorder(row.id).then(response => {
        this.form = response.data;
      });

      this.outHouInfoData = [];
      getOutHouInfo({ orderNumber: row.orderNumber }).then(res => {

          this.outHouInfoData = res.data;
          console.log("🚀 ~ file: index.vue:550 ~ getOutHouInfo ~ this.outHouInfoData :", this.outHouInfoData )

        
      })
    },
    /**
     * 产品下拉框改变事件
     */
    proselectchang(option, index) {
      let ss = this.proselectoptions.find(item => item.id == option)
      this.form.proInfoList[index].proName = ss.proName
      this.form.proInfoList[index].proCode = ss.proCode
      this.form.proInfoList[index].id = option
    },
    /**
     * 删除产品列表
     */
    prodel(index) {
      this.form.proInfoList.splice(index, 1)
    },
    /**
     * 添加产品
     */
    proadd(index) {
      if (index == undefined) {
        this.form.proInfoList.push({
          id: null,
          proName: null,
          proCode: null,
          orderDemandNum: null,
        })
      } else {
        this.form.proInfoList.splice(index + 1, 0,
          {
            id: null,
            proName: null,
            proCode: null,
            orderDemandNum: null,
          })
      }
      console.log(this.form.prolproInfoListist)
    },
    /** 查询产品订单列表 */
    getList() {
      this.loading = true;
      listProorder(this.queryParams).then(response => {
        this.proorderList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
      listProinfo().then(res => {
        this.proselectoptions = res.rows
      })
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        orderNumber: null,
        orderName: null,
        custom: null,
        proInfoList: [],
        orderStatus: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.proCodeExitStatus = false;
      this.banexit = false;
      this.open = true;
      this.title = "添加产品订单";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.proCodeExitStatus = true;
      this.banexit = true;
      this.reset();
      const id = row.id || this.ids
      getProorder(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改产品订单";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateProorder(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addProorder(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除产品订单编号为"' + ids + '"的数据项？').then(function () {
        return delProorder(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => { });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('mes/proorder/export', {
        ...this.queryParams
      }, `proorder_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>

<style scoped>
/deep/.el-tabs__item {
  border-radius: 10px;
}

/deep/.el-tabs--border-card {
  border-radius: 10px;
}

/deep/.el-tabs--border-card>.el-tabs__header,
.el-tabs__item.is-active {
  border-radius: 10px;
}

/deep/.el-tabs--border-card>.el-tabs__content {
  padding: unset;
}

.el-tabs__nav>div {
  border-radius: 10px;
}

#procard>>>.el-card__body {
  /* padding-bottom: unset; */

}

#procard {
  border-radius: 10px;
  margin-bottom: 10px;
  box-shadow: 3px 3px 5px rgba(128, 128, 128, 0.699);
  background-image: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

#stockTag {
  display: block;
}

#stockDiv {

  flex-direction: row;
  margin: 5px;
  text-align: center;
  flex: 1;
}

#stockOptionCard>>>.el-card__body {
  padding-bottom: unset;
  padding-top: 5px;
  padding-left: 5px;
  padding-right: 5px;
  background-image: linear-gradient(135deg, #fdfcfb 0%, #e2d1c3 100%);
}

#stockOptionCard {
  margin-bottom: 5px;
  border-radius: 15px;
}

#stockSpan {
  font-weight: 700;

}

.chooseStockDiv {
  display: inline-block;
  text-align: center;
  position: relative;
  flex: 1;
  margin: 5px;
  /* margin-left: 20px;
  margin-right: 20px; */
  /* background-color: rgba(206, 246, 246, 0.635); */
}

.chooseStockDiv label {
  font-weight: 700;
  font-size: 15px;

}

#daohuobtn {
  height: 45px;
  width: 45px;
  position: relative;
  align-items: center;
  justify-content: center;
  transition: width 0.3s, height 0.3s, border-radius 0.3s;
}

#daohuobtn:hover {
  height: 100%;
  width: 100%;
  border-radius: unset;
}

#stockDrawer>>>.el-drawer__header {
  margin-bottom: unset;
}

#stockDrawer>>>.el-drawer {
  background-color: #c3cfe2;
}

.el-divider__text {
  border-radius: 10px;
}

/deep/.el-scrollbar__wrap {
  overflow-x: hidden;
}

#stockCard>>>.el-card__body {
  padding-bottom: 10px;
}

/deep/ .el-drawer {
  border-radius: 10px;
}

#getHouInfoCard>>>.el-card__body {
  padding: 10px;
}

/* .chooseStockDiv::before {
  content: "";
  position: absolute;
  display: block;
  transform: skewX(-45deg);
  top: -15px;
  left: 20px;
  width: 1;
  height: 100px;
  background-color: rgba(0, 255, 255, 0.507);
} */
</style>
